﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace ZhiAo.CommonLibrary
{
    public static class UIHelper
    {
        ///// <summary>
        ///// 文本框内容自动转化为大写
        ///// </summary>
        ///// <param name="inputbox"></param>
        //public static void AutoUpper(this TextBox inputbox)
        //{
        //    inputbox.Attributes.CssStyle.Add("text-transform", "uppercase");
        //}

        /// <summary>
        /// 设置只能输入英文
        /// </summary>
        /// <param name="txt"></param>
        public static void DefaultIME( this HtmlInputText txt)
        {
            txt.Attributes.Add("style", "ime-mode:disabled");
        }

        /// <summary>
        /// 设置只能输入英文
        /// </summary>
        /// <param name="txt"></param>
        public static void DefaultIME(this TextBox txt)
        {
            txt.Attributes.Add("style", "ime-mode:disabled");
        }

        public static void ResetFocus()
        {
            PageHelper.CurrentPage.Form.Attributes.Add("focus", "");
        }
    }

    
}
